#include "xftp_factory.h"
#include "xftp_server_cmd.h"
#include "xftp_user.h"
#include "xftp_list.h"
#include "xftp_port.h"
#include "xftp_retr.h"
#include "xftp_stor.h"

XFtpFactory::XFtpFactory() {
}

XTask* XFtpFactory::CreateTask() {
    XFtpServerCmd *x = new XFtpServerCmd();

    // 注册ftp消息处理对象
    x->Reg("USER", new XFtpUser());

    XFtpList *list = new XFtpList();
    x->Reg("PWD", list);
    x->Reg("LIST", list);
    x->Reg("CWD", list);
    x->Reg("CDUP", list);

    x->Reg("PORT", new XFtpPort());
    x->Reg("RETR", new XFtpRetr());
    x->Reg("STOR", new XFtpStor());
    return x;
}

